#!/bin/sh

if [ -f Makefile.PL ]; then
    $PERL Makefile.PL
    make || exit 1
    make test || exit 1
    make install DESTDIR=$DESTDIR || exit 1
    find $DESTDIR -name perllocal.pod -type f -exec rm {} \;
    find $DESTDIR -name .packlist -type f -exec rm {} \;
elif [ -f setup.py ]; then
    python setup.py install --root $DESTDIR
else
    ./configure --prefix=$PREFIX || exit 1
    make || exit 1
    make install DESTDIR=$DESTDIR INSTALLROOT=$DESTDIR || exit 1
    rm -f $DESTDIR/usr/local/info/dir
fi

